The present invention relates to a technology for switching between whether a parallel interface is to be used as a big endian or a little endian. More particularly, the present invention relates to a semiconductor device used as a peripheral device such as a transfer slave, and a data processing system which includes a host device such as a transfer master, and a peripheral device such as a transfer slave.
In the case where a parallel interface is performed between a host device and a peripheral device (that is, between a transfer master and a transfer slave, or between a bus master and a bus slave), when the transfer unit of data to be transferred exceeds the number of parallel bits (bus width) of a data bus, the data must be transferred in a plurality of batches. Transfer modes in this case include a big endian and a little endian. In a big endian mode, high-order bytes and low-order bytes of the data are transferred in that order. In a little endian mode, low-order bytes and high-order bytes of the data are transferred in that order. Therefore, the transfer modes must match between the host device and the peripheral device. If the host device transfers data in the big endian mode and the peripheral device receives it in the little endian mode, high-order bytes and low-order bytes of the data received by the peripheral device would be reversed with the data transferred by the host device.
Conventionally, semiconductor devices such as peripheral devices have enabled switching between a big endian and a little endian by pull-up or pull-down of external terminals. However, this would require an extra mode terminal for endian switching.
A technology for automatic switching of endians is disclosed in Patent Document 1. According to it, an endian conversion information part that holds an address value to be subjected to endian switching, and a determination part that automatically determines whether to perform endian switching by comparing address values are provided to enable automatic execution of endian switching.
Japanese Unexamined Patent Publication No. Hei 8 (1996)-305628